{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "50d6380a",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-14T17:05:01.215073Z",
     "start_time": "2021-11-14T17:05:01.208090Z"
    }
   },
   "outputs": [],
   "source": [
    "# Author: jiang\n",
    "# week05: 数据结构之列表\n",
    "\n",
    "# # 用户输入方法: input()\n",
    "# # 回顾上节内容: 登录系统（while循环、input输入）\n",
    "# # 本节：打印(print)输出的一般方法\n",
    "#\n",
    "name = input(\"name: \")\n",
    "age = input(\"age: \")\n",
    "job = input(\"job: \")\n",
    "salary = input(\"salary: \")\n",
    "#\n",
    "# #　注释来写内容存到字符串中\n",
    "# # 知识点1： 字符串拼接 用 + 让打印的结果更直观\n",
    "# # 知识点2： %s占位符，可以把 “+”符号 省略，比较直观的展示变量内容\n",
    "# #          缺点： 如果变量很多，就比较麻烦了\n",
    "# info = '''------INFO %s ------\n",
    "name:%s\n",
    "age:%d\n",
    "job:%s\n",
    "# salary:%d '''%(name,name,age,job,salary)\n",
    "#\n",
    "# # 知识点3: .format() 比起%s 更适合较多变量的打印，不需要考量顺序和出现次数\n",
    "# #          例如 : url 的拼接 (https:// + 域名 + endpoint)\n",
    "# info1 = '''------INFO {HTML_name} ------\n",
    "name:{HTML_name}\n",
    "age:{HTML_age}\n",
    "job:{HTML_job}\n",
    "print(info1)\n",
    "\n",
    "\n",
    "# 假定你要求用户以2021-10-27 格式输入\n",
    "user_input_time = \"2021-10-27\"\n",
    "# 字符串拆分，方法 split 拆分完的结果是一个 列表\n",
    "print(user_input_time.split('-'))\n",
    "print(user_input_time.split('-')[0])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0072c078",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
